package com.zee.wechat.module.sys.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

@RestController
public class IndexController {
	@RequestMapping("/index")
	public ModelAndView index(ModelAndView modelAndView) {
		modelAndView.setViewName("/index");
		return modelAndView;
	}
	@RequestMapping("/login")
	public ModelAndView login(ModelAndView modelAndView) {
		modelAndView.setViewName("/login");
		return modelAndView;
	}
	@RequestMapping("/loginOut")
	public ModelAndView loginOut(ModelAndView modelAndView,HttpSession httpSession) {
		httpSession.removeAttribute("userInfo");
		modelAndView.setViewName("redirect:./");
		return modelAndView;
	}
}
